#include "mainwindow.h"
#include "ui_mainwindow.h"

#include <qqtfindservermanager.h>

#include <QHostInfo>
#include <QHostAddress>

#include <QNetworkInterface>
#include <QNetworkAddressEntry>

#include <qqtframe.h>

#include <qqthostaddressmanager.h>

MainWindow::MainWindow ( QWidget* parent ) :
    QMainWindow ( parent ),
    ui ( new Ui::MainWindow )
{
    ui->setupUi ( this );

    QString hostName = QHostInfo::localHostName();
    QHostInfo hostInfo = QHostInfo::fromName ( hostName );
    p3line() << hostInfo.addresses();

    foreach ( QHostAddress address, hostInfo.addresses() )
    {
        if ( address.protocol() == QAbstractSocket::IPv4Protocol )
            qDebug() << address.toString();
    }

    QQtHostAddressManager m01;
    QByteArray bytes =  m01.dictionary().toJson ( QJsonDocument::Indented );
    qDebug() << qPrintable ( bytes ) ;

    ui->textBrowser->append ( bytes );

    static QQtBeServerManager m1;
    m1;
}

MainWindow::~MainWindow()
{
    delete ui;
}
